import { defHttp } from '/@/utils/http/axios';

enum Api {
  Crud = '/wms/goods/cate',
  Table = '/wms/goods/cate/table',
  List = '/wms/goods/cate/list',
}

export const getTableData = (params:any) => defHttp.get<GoodsCateItem[]>({ url: Api.Table, params: params });

export const getListData = (params?:any) => defHttp.get<GoodsCateItem[]>({ url: Api.List, params: params });

export const create = (params: any) => defHttp.post({url: Api.Crud, params});

export const update = (params: any) => defHttp.put({url: Api.Crud, params});

export const deletes = (params: number[]) => defHttp.delete({url: Api.Crud, data: params});

export interface GoodsCateItem {
  ID: number,
  name: string;
  icon: string;
  enable: number;
  memo: string;
  children: GoodsCateItem[];
}
